/**
 * 制作者：九哥
 * 订单、方便、招聘数据对接
 * 时间：2019-03-01
 * 更新者：
 * */





/**
 * 引入缓存设置文件 cache.js
 * */
document.write("<script type='text/javascript' src='/h5/js/cache.js'></script>");





//var app_access = 'qSoiKwpWVge4TkaryH6MKvOdceGt7ZMaF20g8H0cnXI';





/**
 * --------------------
 * 发布
 * --------------------
 * */

/**
 * 公司订单
 * */
function getPubOrderList(){
    var userInfo = cacheGet('userInfo'); //获取用户信息
    if (userInfo==null || userInfo.token=='undefined') {
        window.location.href = '/h5/login/login.html';
    }
    var data = {
        app_access:app_access,
        token:userInfo.token,
        type:userInfo.type,
        cate:userInfo.cate
    };
    $.ajax({
        type:'post',
        url:getDomain() + 'pub/order-get',
        data:data,
        success:function(res){
            //console.log(res); return;
            if (res.code!=0) {
                console.log(res); return;
            }
            //console.log(res.data); return;
            var data = res.data;
            var i, h = '';
            for (i=0;i<data.length;i++) {
                h += '<table onclick="window.location.href=\'\';">';
                h +=    '<tr>';
                h +=        '<td>';
                if (data[i].img) {
                    h += '<img src="'+data[i].img+'" width="60">';
                } else {
                    h += '<img src="/h5/images/toux01.png" width="60">';
                }
                h +=        '</td>';
                h +=        '<td>';
                h +=            '<p>';
                h +=                '<b>'+data[i].name+'</b>';
                h +=                '<span>'+data[i].statusName+'</span>';
                h +=            '</p>';
                h +=            '<small>过期时间：'+data[i].periodName+'</small>';
                h +=        '</td>';
                h +=    '</tr>';
                h += '</table>';
            }
            $('#orderlist').html(h);
        },
        error:function(){
            console.log('操作失败！'); return;
        }
    });
}

/**
 * 公司招聘
 * */
function getPubJobList() {
    var userInfo = cacheGet('userInfo'); //获取用户信息
    if (userInfo == null || userInfo.token == 'undefined') {
        window.location.href = '/h5/login/login.html';
    }
    var data = {
        app_access: app_access,
        token: userInfo.token,
        type: userInfo.type,
        cate: userInfo.cate
    };
    $.ajax({
        type: 'post',
        url: getDomain() + 'pub/job-get',
        data: data,
        success: function (res) {
            //console.log(res); return;
            if (res.code != 0) {
                $('#joblist').html('<div class="load">没有记录</div>');
                console.log(res); return;
            }
            var data = res.data;
            var i, h = '';
            for (i=0;i<data.length;i++) {
                h += '<div class="tab-panel-item tab-active">';
                h +=    '<a href="" class="aui-flex">';
                h +=        '<div class="aui-look-img">';
                if (data[i].thumb) {
                    h += '<img src="'+data[i].thumb+'" width="60">';
                } else {
                    h += '<span></span>';
                }
                h +=        '</div>';
                h +=        '<div class="aui-flex-box">';
                h +=            '<h3>'+data[i].jobName+'</h3>';
                h +=            '<p>需要'+data[i].num+'名，要求...</p>';
                h +=        '</div>';
                h +=        '<div class="orderNotice">新发布</div>';
                h +=    '</a>';
                h += '</div>';
                h += '<hr>';
            }
            $('#joblist').html(h);
        },
        error: function () {
            console.log('操作失败！'); return;
        }
    });
}

/**
 * 公司资讯
 * */
function getPubNewsList() {
    var userInfo = cacheGet('userInfo'); //获取用户信息
    if (userInfo == null || userInfo.token == 'undefined') {
        window.location.href = '/h5/login/login.html';
    }
    var data = {
        app_access: app_access,
        token: userInfo.token,
        type: userInfo.type,
        cate: userInfo.cate
    };
    $.ajax({
        type: 'post',
        url: getDomain() + 'pub/news-get',
        data: data,
        success: function (res) {
            //console.log(res); return;
            if (res.code == -3) {
                $('#newslist p ').text('暂时没有发布的资讯哦！')
            } else if (res.code != 0) {
                console.log(res); return;
            }
            //console.log(res.data); return;
            var data = res.data;
            var h = '';
            for (var i=0;i<data.length;i++) {
                h += '<div class="tab-panel-item tab-active">';
                h +=    '<a href="" class="aui-flex">';
                h +=        '<div class="aui-look-img">';
                if (data[i].thumb) {
                    h += '<img src="'+data[i].thumb+'" width="60">';
                } else {
                    h += '<span></span>';
                }
                h +=        '</div>';
                h +=        '<div class="aui-flex-box">';
                if (data[i].title.length < 5) {
                    h += '<h3>'+data[i].title+'</h3>';
                } else {
                    h += '<h3>'+data[i].title.substring(0,5)+'...</h3>';
                }
                if (data[i].content.length < 10) {
                    h += '<p>'+data[i].content+'</p>';
                } else {
                    h += '<p>'+data[i].content.substring(0,10)+'...</p>';
                }
                h +=        '</div>';
                h +=        '<div class="orderNotice">'+data[i].statusName+'</div>';
                h +=    '</a>';
                h += '</div>';
                h += '<hr>';
            }
            $('#newslist').html(h);
        },
        error: function () {
            console.log('操作失败！'); return;
        }
    });
}

/**
 * --------------------
 * 发布
 * --------------------
 * */





/**
 * --------------------
 * 订单
 * --------------------
 * */

/**
 * 公司抢单列表，本公司货单
 * */
function getComOrderList(){
    var userInfo = cacheGet('userInfo'); //获取用户信息
    if (userInfo==null || userInfo.token=='undefined') {
        window.location.href = '/h5/login/login.html';
    }
    var data = {
        app_access:app_access,
        token:userInfo.token,
        type:userInfo.type,
        cate:userInfo.cate
    };
    $.ajax({
        type:'post',
        url:getDomain() + 'order/com-order-list-get',
        data:data,
        success:function(res){
            //console.log(res); return;
            if (res.code!=0) {
                $('#templist').html('<p style="text-align:center;line-height:100px;">没有记录</p>');
                console.log(res); return;
            }
            //console.log(res.data); return;
            var data = res.data;
            var i, h = '';
            for (i=0;i<data.length;i++) {
                h += '<div class="tab-panel-item tab-active">';
                h +=    '<a class="aui-flex" href="javascript:;" onclick="toOrderComShow('+data[i].id+')">';
                h +=        '<div class="aui-look-img">';
                if (data[i].img) {
                    h += '<img src="'+data[i].img+'" height="100">';
                } else {
                    h += '<img src="/h5/images/tu.png">';
                }
                h +=        '</div>';
                h +=        '<div class="aui-flex-box">';
                h +=            '<h3>'+data[i].name+'</h3>';
                h +=            '<p class="getOrder">有效至'+data[i].periodName+'</p>';
                h +=        '</div>';
                h +=        '<div class="orderNoticeTime">'+data[i].statusName+'</div>';
                h +=    '</a>';
                h += '</div><hr/>';
            }
            $('#templist').html(h);
        },
        error:function(){
            console.log('操作失败！'); return;
        }
    });
}

/**
 * 公司抢单详情，设置
 * */
function toOrderComShow(id){
    var userInfo = cacheGet('userInfo'); //获取用户信息
    if (userInfo==null || userInfo.token=='undefined') {
        window.location.href = '/h5/login/login.html';
    }
    cacheSet('toMyOrderComShowId',id); //当前抢单详情
    window.location.href = 'comShow.html';
}

/**
 * 公司抢单详情，获取
 * */
function getOrderComShow(){
    var userInfo = cacheGet('userInfo'); //获取用户信息
    var id = cacheGet('toMyOrderComShowId');
    if (userInfo==null || userInfo.token=='undefined') {
        window.location.href = '/h5/login/login.html';
    }
    if (id==null) { history.go(-1); }
    var data = {
        app_access:app_access,
        token:userInfo.token,
        type:userInfo.type,
        cate:userInfo.cate,
        bale:id
    };
    $.ajax({
        type:'post',
        url:getDomain() + 'order/com-show',
        data:data,
        success:function(res){
            //console.log(res); return;
            if (res.code!=0) {
                $('#faclist').html('<p style="text-align:center;line-height:100px;">没有记录</p>');
                console.log(res); return;
            }
            //console.log(res.data); return;
            var bale = res.data.bale;
            var temps = res.data.temps;
            var i, h = '';
            $('#orderToShow').html('当前货单：'+bale.name);
            for (i=0;i<temps.length;i++) {
                h += '<table><tr>';
                h +=    '<td>';
                if (temps[i].facHead) {
                    h += '<img src="'+temps[i].facHead+'" width="60">';
                } else {
                    h += '<img src="/uploads/20190227/orderShowSmall01.png" width="60">';
                }
                h +=    '</td>';
                h +=    '<td>';
                h +=        '<p style="line-height:10px">';
                h +=            '<b>'+temps[i].facName+'</b>';
                h +=            '<span onclick="toFacShow('+temps[i].uid+')">查看该工厂</span>';
                h +=        '</p>';
                h +=        '<small>抢单时间：'+temps[i].createTime+'</small>';
                h +=        '<span onclick="setFacToOrder('+temps[i].uid+')">选中合作</span>';
                h +=    '</td>';
                h += '</tr></table>';
            }
            $('#faclist').html(h);
        },
        error:function(){
            console.log('操作失败！'); return;
        }
    });
}

/**
 * 公司，查看工厂
 * */
function toFacShow(fid){
    var userInfo = cacheGet('userInfo'); //获取用户信息
    if (userInfo==null || userInfo.token=='undefined') {
        window.location.href = '/h5/login/login.html';
    }
    //cacheSet('toMyOrderShowId',id); //当前抢单详情
    //window.location.href = '/h5/index/facShow.html';
    getErrMsg('跳转到工厂主页，待对接！',''); return;
}

/**
 * 公司，选中工厂
 * */
function setFacToOrder(fid){
    var userInfo = cacheGet('userInfo'); //获取用户信息
    if (userInfo==null || userInfo.token=='undefined') {
        window.location.href = '/h5/login/login.html';
    }
    getErrMsg('工厂选中对接',''); return;
    var data = {
        app_access:app_access,
        token:userInfo.token,
        type:userInfo.type,
        cate:userInfo.cate,
        fid:fid
    };
    $.ajax({
        type:'post',
        url:getDomain() + 'order/com-partner-set',
        data:data,
        success:function(res){
            //console.log(res); return;
            if (res.code!=0) {
                console.log(res); return;
            }
            //console.log(res.data); return;
            getErrMsg('操作成功！','/h5/my/order/com.html'); return;
        },
        error:function(){
            console.log('操作失败！'); return;
        }
    });
}

/**
 * 工厂抢单，公司货单
 * */
function getFacOrderList(){
    var userInfo = cacheGet('userInfo'); //获取用户信息
    if (userInfo==null || userInfo.token=='undefined') {
        window.location.href = '/h5/login/login.html';
    }
    var data = {
        app_access:app_access,
        token:userInfo.token,
        type:userInfo.type,
        cate:userInfo.cate
    };
    $.ajax({
        type:'post',
        url:getDomain() + 'order/fac-order-list-get',
        data:data,
        success:function(res){
            //console.log(res); return;
            if (res.code!=0) {
                $('#templist').html('<p style="text-align:center;line-height:100px;">没有记录</p>');
                console.log(res); return;
            }
            //console.log(res.data); return;
            var data = res.data;
            var i, h = '';
            for (i=0;i<data.length;i++) {
                h += '<div class="tab-panel-item tab-active">';
                h +=    '<a class="aui-flex" href="javascript:;" onclick="toOrderFacShow('+data[i].id+')">';
                h +=        '<div class="aui-look-img">';
                if (data[i].img) {
                    h += '<img src="'+data[i].img+'" height="100">';
                } else {
                    h += '<img src="/h5/images/tu.png">';
                }
                h +=        '</div>';
                h +=        '<div class="aui-flex-box">';
                h +=            '<h3>'+data[i].name+'</h3>';
                h +=            '<p class="getOrder">有效至'+data[i].periodName+'</p>';
                h +=        '</div>';
                //h +=        '<div class="orderNoticeTime">'+data[i].statusName+'</div>';
                h +=        '<div class="orderNoticeTime">'+data[i].comName+'</div>';
                h +=    '</a>';
                h += '</div><hr/>';
            }
            $('#templist').html(h);
        },
        error:function(){
            console.log('操作失败！'); return;
        }
    });
}

/**
 * 工厂，抢单详情设置
 * */
function toOrderFacShow(id){
    var userInfo = cacheGet('userInfo'); //获取用户信息
    if (userInfo==null || userInfo.token=='undefined') {
        window.location.href = '/h5/login/login.html';
    }
    cacheSet('toMyOrderFacShowId',id); //当前抢单详情
    window.location.href = 'facShow.html';
}

/**
 * 工厂，抢单详情获取
 * */
function getOrderFacShow(){
    var userInfo = cacheGet('userInfo'); //获取用户信息
    var id = cacheGet('toMyOrderFacShowId');
    if (userInfo==null || userInfo.token=='undefined') {
        window.location.href = '/h5/login/login.html';
    }
    if (id==null) { history.go(-1); }
    var data = {
        app_access:app_access,
        token:userInfo.token,
        type:userInfo.type,
        cate:userInfo.cate,
        bale:id
    };
    $.ajax({
        type:'post',
        url:getDomain() + 'order/fac-show',
        data:data,
        success:function(res){
            //console.log(res); return;
            if (res.code!=0) {
                getErrMsg(res.msg,''); return;
                //console.log(res); return;
            }
            console.log(res.data);
            var bale = res.data.bale;
            var temps = res.data.temps;
            var factory = res.data.factory;
            if (bale.img) {
                $('.orderImg').html('<img src="'+bale.img+'" width="100%"/>');
            } else {
                $('.orderImg').html('<img src="/uploads/20190227/orderShowBig.png" width="100%"/>');
            }
            $('#baleId')[0].value = bale.id;
            $('#orderFacNum').html(temps.length);
            var h = '';
            h += '<table>';
            h += '<tr><td width="100"><b>颜色</b></td><td>'+bale.color+'</td></tr>';
            h += '<tr><td><b>设计</b></td><td>'+bale.design+'</td></tr>';
            h += '<tr><td><b>尺寸</b></td><td>'+bale.size+'</td></tr>';
            h += '</table>';
            $('#orderShowAttr').html(h);
            if (bale.detail) {
                $('#orderConDetail').html(bale.detail);
            }
            $('#orderNum').html(bale.num+'件');
            $('#orderMoney').html(bale.money+'元');
            $('#orderPeriod').html(bale.periodTime);
            $('#facName').html(factory.com_name);
            $('#facAddress').html(factory.com_address);
        },
        error:function(){
            console.log('操作失败！'); return;
        }
    });
}

/**
 * 工厂，抢单保证金
 * */
function setOrderEnsure(){
    var userInfo = cacheGet('userInfo'); //获取用户信息
    if (userInfo==null || userInfo.token=='undefined') {
        window.location.href = '/h5/login/login.html';
    }
    getErrMsg('支付抢单保证金，待对接！',''); return;
}

/**
 * 工厂，立即抢单
 * */
function setOrderAdd(){
    var userInfo = cacheGet('userInfo'); //获取用户信息
    var bale = $('#baleId').val();
    if (userInfo==null || userInfo.token=='undefined') {
        window.location.href = '/h5/login/login.html';
    }
    getErrMsg('立即抢单，待对接！',''); return;
    //var data = {
    //    app_access:app_access,
    //    token:userInfo.token,
    //    type:userInfo.type,
    //    cate:userInfo.cate,
    //    bale:bale
    //};
    //$.ajax({
    //    type:'post',
    //    url:getDomain() + 'order/fac-order-add-set',
    //    data:data,
    //    success:function(res) {
    //        //console.log(res); return;
    //        if (res.code != 0) {
    //            getErrMsg(res.msg,''); return;
    //        }
    //    },
    //    error:function(){
    //        getErrMsg('操作失败！',''); return;
    //    }
    //});
}

/**
 * 本公司，生产中订单
 * */
function getComOrderTemp(){
    var userInfo = cacheGet('userInfo'); //获取用户信息
    if (userInfo==null || userInfo.token=='undefined') {
        window.location.href = '/h5/login/login.html';
    }
    var data = {
        app_access:app_access,
        token:userInfo.token,
        type:userInfo.type,
        cate:userInfo.cate
    };
    $.ajax({
        type:'post',
        url:getDomain() + 'order/com-order-make-get',
        data:data,
        success:function(res){
            //console.log(res); return;
            if (res.code!=0) {
                $('#orderlist').html('<p style="text-align:center;line-height:100px;">没有记录</p>');
                console.log(res); return;
            }
            console.log(res.data);
            var data = res.data;
            var i, h = '';
            for (i=0;i<data.length;i++) {
                //h += '<div class="tab-panel-item tab-active">';
                //h +=    '<a class="aui-flex" href="">';
                //h +=        '<div class="aui-look-img">';
                //if (data[i].baleImg) {
                //    h += '<img src="'+data[i].baleImg+'" height="100">';
                //} else {
                //    h += '<img src="/h5/images/tu.png">';
                //}
                //h +=        '</div>';
                //h +=        '<div class="aui-flex-box">';
                //h +=            '<h3>'+data[i].baleName+'</h3>';
                //h +=            '<p class="getOrder">'+data[i].facName+'</p>';
                //h +=        '</div>';
                //h +=        '<div class="orderNoticeTime">'+data[i].periodName+'</div>';
                //h +=    '</a>';
                //h += '</div><hr/>';
                h += '<table><tr>';
                h +=    '<td>';
                if (data[i].baleImg) {
                    h += '<img src="'+data[i].baleImg+'" height="60">';
                } else {
                    h += '<img src="/h5/images/tu.png" height="60">';
                }
                h +=    '</td>';
                h +=    '<td>';
                h +=        '<p style="line-height:10px">';
                h +=            '<b>'+data[i].baleName+'</b>';
                h +=            '<span onclick="toFacShow('+data[i].facId+')">'+data[i].facName+'</span>';
                h +=        '</p>';
                h +=        '<small>抢单：'+data[i].periodName+'</small>';
                h +=        '<span onclick="toComTrack('+data[i].id+')">生产跟单</span>';
                h +=    '</td>';
                h += '</tr></table>';
            }
            $('#orderlist').html(h);
        },
        error:function(){
            console.log('操作失败！'); return;
        }
    });
}

/**
 * 公司，生产跟单页面设置
 * */
function toComTrack(id){
    var userInfo = cacheGet('userInfo'); //获取用户信息
    if (userInfo==null || userInfo.token=='undefined') {
        window.location.href = '/h5/login/login.html';
    }
    if (id==null || id==0) {
        getErrMsg('订单不存在！',''); return;
    }
    var comOrderTrack = {
        'orderId':id
    };
    cacheSet('comOrderTrack',comOrderTrack);
    window.location.href = 'comTrack.html';
}

/**
 * 公司，生产跟单获取
 * */
function getComTrack(){
    var userInfo = cacheGet('userInfo'); //获取用户信息
    var comOrderTrack = cacheGet('comOrderTrack'); //获取orderId
    if (userInfo==null || userInfo.token=='undefined') {
        window.location.href = '/h5/login/login.html';
    }
    if (comOrderTrack==null || comOrderTrack.orderId==0) {
        getErrMsg('订单不存在！',''); return;
    }
    var data = {
        app_access:app_access,
        token:userInfo.token,
        type:userInfo.type,
        cate:userInfo.cate,
        orderId:comOrderTrack.orderId
    };
    $.ajax({
        type:'post',
        url:getDomain() + 'order/com-order-track-get',
        data:data,
        success:function(res){
            //console.log(res); return;
            if (res.code!=0) {
                console.log(res); return;
            }
            console.log(res.data);
            var data = res.data;
            var img;
            if (data.baleImg) {
                img = '<img src="'+data.baleImg+'" width="60"/>';
            } else {
                img = '<img src="/uploads/20190227/orderShowSmall01.png" width="60"/>';
            }
            $('#orderImg').html(img);
            $('#orderDetail').html(data.baleDetail);
            $('#orderFacName').html(data.comName);
            $('#orderFacAddress').html(data.comAddress);
            $('#leaderName').html(data.leaderName);
            $('#leaderMobile').html(data.leaderMobile);
            $('#orderNum').html(data.orderNum);
            $('#orderMoney').html(data.orderMoney);
            $('#periodTime').html(data.periodTime);
            var btn = '<p><button onclick="toComCheck()">下一页</button></p>';
            $('#orderParamBtn').html(btn);
            //更新本地comOrderTrack
            comOrderTrack = {
                orderId:comOrderTrack.orderId,
                orderFacName:data.comName,
                orderFacAddress:data.comAddress,
                orderNum:data.orderNum,
                orderMoney:data.orderMoney,
                periodTime:data.periodTime,
                leaderName:data.leaderName,
                leaderMobile:data.leaderMobile,
            };
            cacheSet('comOrderTrack',comOrderTrack);
        },
        error:function(){
            console.log('操作失败！'); return;
        }
    });
}

/**
 * 公司，跳转到跟单页面
 * */
function toComCheck(){
    var userInfo = cacheGet('userInfo'); //获取用户信息
    var comOrderTrack = cacheGet('comOrderTrack');
    if (userInfo==null || userInfo.token=='undefined') {
        window.location.href = '/h5/login/login.html';
    }
    if (comOrderTrack==null || comOrderTrack.orderId==0) {
        getErrMsg('订单不存在！',''); return;
    }
    window.location.href = 'comCheck.html';
}

/**
 * 公司，跟单验收报告
 * */
function getComCheck(){
    var userInfo = cacheGet('userInfo'); //获取用户信息
    var comOrderTrack = cacheGet('comOrderTrack');
    if (userInfo==null || userInfo.token=='undefined') {
        window.location.href = '/h5/login/login.html';
    }
    if (comOrderTrack==null || comOrderTrack.orderId==0) {
        getErrMsg('订单不存在！',''); return;
    }
    //console.log(comOrderTrack);
    $('#orderFacName').html(comOrderTrack.orderFacName);
    $('#leaderMobile').html(comOrderTrack.leaderMobile);
    var data = {
        app_access:app_access,
        token:userInfo.token,
        type:userInfo.type,
        cate:userInfo.cate,
        orderId:comOrderTrack.orderId
    };
    $.ajax({
        type:'post',
        url:getDomain() + 'order/com-order-check-get',
        data:data,
        success:function(res){
            //console.log(res); return;
            if (res.code!=0) {
                console.log(res); return;
            }
            console.log(res.data);
            $('#detail').html(res.data.detail);
            $('#finishTime').html(res.data.finishTime);
            if (res.data.staffStyleNum != 0) {
                $('#staffStyleNum').html(res.data.staffStyleNum);
            }
            if (res.data.staffTotalNum != 0) {
                $('#staffTotalNum').html(res.data.staffTotalNum);
            }
            var stylelist = res.data.stylelist;
            var sizelist = res.data.sizelist;
            var thrumlist = res.data.thrumlist;
            $('#styleNo')[0].value = stylelist.styleNo;
            $('#fabric')[0].value = stylelist.fabric;
            $('#assist')[0].value = stylelist.assist;
            $('#orderNum')[0].value = stylelist.orderNum;
            $('#cutNum')[0].value = stylelist.cutNum;
            $('#backNum')[0].value = stylelist.backNum;
            $('#styleNum')[0].value = stylelist.styleNum;
            $('#period')[0].value = stylelist.period;
            $('#waist_1')[0].value = sizelist.waist[0];
            $('#waist_2')[0].value = sizelist.waist[1];
            $('#waist_3')[0].value = sizelist.waist[2];
            $('#waist_4')[0].value = sizelist.waist[3];
            $('#hip_1')[0].value = sizelist.hip[0];
            $('#hip_2')[0].value = sizelist.hip[1];
            $('#hip_3')[0].value = sizelist.hip[2];
            $('#hip_4')[0].value = sizelist.hip[3];
            $('#trouser_1')[0].value = sizelist.trouser[0];
            $('#trouser_2')[0].value = sizelist.trouser[1];
            $('#trouser_3')[0].value = sizelist.trouser[2];
            $('#trouser_4')[0].value = sizelist.trouser[3];
            $('#bust_1')[0].value = sizelist.bust[0];
            $('#bust_2')[0].value = sizelist.bust[1];
            $('#bust_3')[0].value = sizelist.bust[2];
            $('#bust_4')[0].value = sizelist.bust[3];
            $('#hem_1')[0].value = sizelist.hem[0];
            $('#hem_2')[0].value = sizelist.hem[1];
            $('#hem_3')[0].value = sizelist.hem[2];
            $('#hem_4')[0].value = sizelist.hem[3];
            var h = '', h2 = '', h3 = '';
            $('#thrum_1')[0].value = thrumlist.thrum[0];
            $('#thrum_2')[0].value = thrumlist.thrum[1];
            $('#thrum_3')[0].value = thrumlist.thrum[2];
            h += '<input type="radio" name="radio1" onclick="setThrum(1)"';
            if (thrumlist.thrum[0]==1) { h += ' checked'; }
            h += '>有 ';
            h2 += '<input type="radio" name="radio1" onclick="setThrum(2)"';
            if (thrumlist.thrum[0]==2) { h2 += ' checked'; }
            h2 += '>少 ';
            h3 += '<input type="radio" name="radio1" onclick="setThrum(3)"';
            if (thrumlist.thrum[0]==3) { h3 += ' checked'; }
            h3 += '>从剪 ';
            $('#thrumInput1').html(h);
            $('#thrumInput2').html(h2);
            $('#thrumInput3').html(h3);
            var h4 = '', h5 = '', h6 = '';
            $('#smear_1')[0].value = thrumlist.smear[0];
            $('#smear_2')[0].value = thrumlist.smear[1];
            $('#smear_3')[0].value = thrumlist.smear[2];
            h4 += '<input type="radio" name="radio2" onclick="setSmear(1)"';
            if (thrumlist.smear[0]==1) { h4 += ' checked'; }
            h4 += '>有 ';
            h5 += '<input type="radio" name="radio2" onclick="setSmear(2)"';
            if (thrumlist.smear[0]==2) { h5 += ' checked'; }
            h5 += '>少 ';
            h6 += '<input type="radio" name="radio2" onclick="setSmear(3)"';
            if (thrumlist.smear[0]==3) { h6 += ' checked'; }
            h6 += '>无 ';
            $('#smearInput1').html(h4);
            $('#smearInput2').html(h5);
            $('#smearInput3').html(h6);
            var h7 = '', h8 = '', h9 = '';
            $('#hair_1')[0].value = thrumlist.hair[0];
            $('#hair_2')[0].value = thrumlist.hair[1];
            $('#hair_3')[0].value = thrumlist.hair[2];
            h7 += '<input type="radio" name="radio3" onclick="setHair(1)"';
            if (thrumlist.hair[0]==1) { h7 += ' checked'; }
            h7 += '>有 ';
            h8 += '<input type="radio" name="radio3" onclick="setHair(2)"';
            if (thrumlist.hair[0]==2) { h8 += ' checked'; }
            h8 += '>少 ';
            h9 += '<input type="radio" name="radio3" onclick="setHair(3)"';
            if (thrumlist.hair[0]==3) { h9 += ' checked'; }
            h9 += '>无 ';
            $('#hairInput1').html(h7);
            $('#hairInput2').html(h8);
            $('#hairInput3').html(h9);
            var h10 = '', h11 = '';
            $('#size_1')[0].value = thrumlist.size[0];
            $('#size_2')[0].value = thrumlist.size[1];
            $('#size_3')[0].value = thrumlist.size[2];
            h10 += '<input type="radio" name="radio4" onclick="seSize(1)"';
            if (thrumlist.size[0]==1) { h10 += ' checked'; }
            h10 += '>超出误差范围 ';
            h11 += '<input type="radio" name="radio4" onclick="setSize(2)"';
            if (thrumlist.size[0]==2) { h11 += ' checked'; }
            h11 += '>在误差范围内 ';
            $('#sizeInput1').html(h10);
            $('#sizeInput2').html(h11);
            var h12 = '', h13 = '';
            $('#list_1')[0].value = thrumlist.list[0];
            $('#list_2')[0].value = thrumlist.list[1];
            $('#list_3')[0].value = thrumlist.list[2];
            h12 += '<input type="radio" name="radio5" onclick="setList(1)"';
            if (thrumlist.list[0]==1) { h12 += ' checked'; }
            h12 += '>清楚 ';
            h13 += '<input type="radio" name="radio5" onclick="setList(2)"';
            if (thrumlist.list[0]==2) { h13 += ' checked'; }
            h13 += '>重填 ';
            $('#listInput1').html(h12);
            $('#listInput2').html(h13);
            var h14 = '', h15 = '';
            $('#tangent_1')[0].value = thrumlist.tangent[0];
            $('#tangent_2')[0].value = thrumlist.tangent[1];
            $('#tangent_3')[0].value = thrumlist.tangent[2];
            h14 += '<input type="radio" name="radio6" onclick="setTangent(1)"';
            if (thrumlist.tangent[0]==1) { h14 += ' checked'; }
            h14 += '>清楚 ';
            h15 += '<input type="radio" name="radio6" onclick="setTangent(2)"';
            if (thrumlist.tangent[0]==2) { h15 += ' checked'; }
            h15 += '>重填 ';
            $('#tangentInput1').html(h14);
            $('#tangentInput2').html(h15);
            var h16 = '', h17 = '';
            $('#pack_1')[0].value = thrumlist.pack[0];
            $('#pack_2')[0].value = thrumlist.pack[1];
            $('#pack_3')[0].value = thrumlist.pack[2];
            h16 += '<input type="radio" name="radio7" onclick="setPack(1)"';
            if (thrumlist.pack[0]==1) { h16 += ' checked'; }
            h16 += '>是 ';
            h17 += '<input type="radio" name="radio7" onclick="setPack(2)"';
            if (thrumlist.pack[0]==2) { h17 += ' checked'; }
            h17 += '>返修 ';
            $('#packInput1').html(h16);
            $('#packInput2').html(h17);
            var h18 = '', h19 = '';
            $('#ironing_1')[0].value = thrumlist.ironing[0];
            $('#ironing_2')[0].value = thrumlist.ironing[1];
            $('#ironing_3')[0].value = thrumlist.ironing[2];
            h18 += '<input type="radio" name="radio8" onclick="setIroning(1)"';
            if (thrumlist.ironing[0]==1) { h18 += ' checked'; }
            h18 += '>是 ';
            h19 += '<input type="radio" name="radio8" onclick="setIroning(2)"';
            if (thrumlist.ironing[0]==2) { h19 += ' checked'; }
            h19 += '>返修 ';
            $('#ironingInput1').html(h18);
            $('#ironingInput2').html(h19);
            var h20 = '', h21 = '', h22 = '';
            $('#devote_1')[0].value = thrumlist.devote[0];
            $('#devote_2')[0].value = thrumlist.devote[1];
            $('#devote_3')[0].value = thrumlist.devote[2];
            h20 += '<input type="radio" name="radio9" onclick="setDevote(1)"';
            if (thrumlist.devote[0]==1) { h20 += ' checked'; }
            h20 += '>是 ';
            h21 += '<input type="radio" name="radio9" onclick="setDevote(2)"';
            if (thrumlist.devote[0]==2) { h21 += ' checked'; }
            h21 += '>一般 ';
            h22 += '<input type="radio" name="radio9" onclick="setDevote(3)"';
            if (thrumlist.devote[0]==3) { h22 += ' checked'; }
            h22 += '>不是 ';
            $('#devoteInput1').html(h20);
            $('#devoteInput2').html(h21);
            $('#devoteInput3').html(h22);
        },
        error:function(){
            console.log('操作失败！'); return;
        }
    });
}

/**
 * 公司，跟单报告设置
 * */
function setComCheck(){
    var userInfo = cacheGet('userInfo'); //获取用户信息
    var comOrderTrack = cacheGet('comOrderTrack');
    if (userInfo==null || userInfo.token=='undefined') {
        window.location.href = '/h5/login/login.html';
    }
    if (comOrderTrack==null || comOrderTrack.orderId==0) {
        getErrMsg('订单不存在！',''); return;
    }
    var styleNo = $('#styleNo').val();
    var fabric = $('#fabric').val();
    var assist = $('#assist').val();
    var orderNum = $('#orderNum').val();
    var cutNum = $('#cutNum').val();
    var staffNum = $('#staffNum').val();
    var trimNum = $('#trimNum').val();
    var backNum = $('#backNum').val();
    var styleNum = $('#styleNum').val();
    var period = $('#period').val();
    var waist_1 = $('#waist_1').val();
    var waist_2 = $('#waist_2').val();
    var waist_3 = $('#waist_3').val();
    var waist_4 = $('#waist_4').val();
    var hip_1 = $('#hip_1').val();
    var hip_2 = $('#hip_2').val();
    var hip_3 = $('#hip_3').val();
    var hip_4 = $('#hip_4').val();
    var trouser_1 = $('#trouser_1').val();
    var trouser_2 = $('#trouser_2').val();
    var trouser_3 = $('#trouser_3').val();
    var trouser_4 = $('#trouser_4').val();
    var bust_1 = $('#bust_1').val();
    var bust_2 = $('#bust_2').val();
    var bust_3 = $('#bust_3').val();
    var bust_4 = $('#bust_4').val();
    var hem_1 = $('#hem_1').val();
    var hem_2 = $('#hem_2').val();
    var hem_3 = $('#hem_3').val();
    var hem_4 = $('#hem_4').val();
    var thrum_1 = $('#thrum_1').val();
    var thrum_2 = $('#thrum_2').val();
    var thrum_3 = $('#thrum_3').val();
    var smear_1 = $('#smear_1').val();
    var smear_2 = $('#smear_2').val();
    var smear_3 = $('#smear_3').val();
    var hair_1 = $('#hair_1').val();
    var hair_2 = $('#hair_2').val();
    var hair_3 = $('#hair_3').val();
    var size_1 = $('#size_1').val();
    var size_2 = $('#size_2').val();
    var size_3 = $('#size_3').val();
    var list_1 = $('#list_1').val();
    var list_2 = $('#list_2').val();
    var list_3 = $('#list_3').val();
    var tangent_1 = $('#tangent_1').val();
    var tangent_2 = $('#tangent_2').val();
    var tangent_3 = $('#tangent_3').val();
    var pack_1 = $('#pack_1').val();
    var pack_2 = $('#pack_2').val();
    var pack_3 = $('#pack_3').val();
    var ironing_1 = $('#ironing_1').val();
    var ironing_2 = $('#ironing_2').val();
    var ironing_3 = $('#ironing_3').val();
    var devote_1 = $('#devote_1').val();
    var devote_2 = $('#devote_2').val();
    var devote_3 = $('#devote_3').val();
    var detail = $('#detail').val();
    var staffTotalNum = $('#staffTotalNum').val();
    var staffStyleNum = $('#staffStyleNum').val();
    var finishTime = $('#finishTime').val();
    if (styleNo=='') { getErrMsg('款号没填写！',''); return; }
    if (fabric=='') { getErrMsg('面料没填写！',''); return; }
    if (assist=='') { getErrMsg('辅料没填写！',''); return; }
    if (orderNum=='') { getErrMsg('订单数量没填写！',''); return; }
    if (cutNum=='') { getErrMsg('裁剪数量没填写！',''); return; }
    if (staffNum=='') { getErrMsg('生产本款人数没填写！',''); return; }
    if (trimNum=='') { getErrMsg('裁制当天下货数量没填写！',''); return; }
    if (backNum=='') { getErrMsg('后道当天送货数量没填写！',''); return; }
    if (styleNum=='') { getErrMsg('本款送货总数没填写！',''); return; }
    if (period=='') { getErrMsg('预计全部结束时间没填写！',''); return; }
    if (waist_1=='') { getErrMsg('领围/腰围没填写！',''); return; }
    if (waist_2=='') { getErrMsg('领围/腰围2没填写！',''); return; }
    if (waist_3=='') { getErrMsg('领围/腰围3没填写！',''); return; }
    if (waist_4=='') { getErrMsg('领围/腰围4没填写！',''); return; }
    if (hip_1=='') { getErrMsg('袖长/臀围没填写！',''); return; }
    if (hip_2=='') { getErrMsg('袖长/臀围2没填写！',''); return; }
    if (hip_3=='') { getErrMsg('袖长/臀围3没填写！',''); return; }
    if (hip_4=='') { getErrMsg('袖长/臀围4没填写！',''); return; }
    if (trouser_1=='') { getErrMsg('后中长/裤长没填写！',''); return; }
    if (trouser_2=='') { getErrMsg('后中长/裤长2没填写！',''); return; }
    if (trouser_3=='') { getErrMsg('后中长/裤长3没填写！',''); return; }
    if (trouser_4=='') { getErrMsg('后中长/裤长4没填写！',''); return; }
    if (bust_1=='') { getErrMsg('胸围/拉链没填写！',''); return; }
    if (bust_2=='') { getErrMsg('胸围/拉链2没填写！',''); return; }
    if (bust_3=='') { getErrMsg('胸围/拉链3没填写！',''); return; }
    if (bust_4=='') { getErrMsg('胸围/拉链4没填写！',''); return; }
    if (hem_1=='') { getErrMsg('下摆/脚口没填写！',''); return; }
    if (hem_2=='') { getErrMsg('下摆/脚口2没填写！',''); return; }
    if (hem_3=='') { getErrMsg('下摆/脚口3没填写！',''); return; }
    if (hem_4=='') { getErrMsg('下摆/脚口4没填写！',''); return; }
    if (thrum_1==0) { getErrMsg('线头情况没填选！',''); return; }
    if (thrum_2=='') { getErrMsg('线头情况2没填写！',''); return; }
    if (thrum_3=='') { getErrMsg('线头情况3没填写！',''); return; }
    if (smear_1==0) { getErrMsg('污迹情况没填选！',''); return; }
    if (smear_2=='') { getErrMsg('污迹情况2没填写！',''); return; }
    if (smear_3=='') { getErrMsg('污迹情况3没填写！',''); return; }
    if (hair_1==0) { getErrMsg('毛脱落情况没填选！',''); return; }
    if (hair_2=='') { getErrMsg('毛脱落情况2没填写！',''); return; }
    if (hair_3=='') { getErrMsg('毛脱落情况3没填写！',''); return; }
    if (size_1==0) { getErrMsg('尺寸情况没填选！',''); return; }
    if (size_2=='') { getErrMsg('尺寸情况2没填写！',''); return; }
    if (size_3=='') { getErrMsg('尺寸情况3没填写！',''); return; }
    if (list_1==0) { getErrMsg('送货单是否清楚没填选！',''); return; }
    if (list_2=='') { getErrMsg('送货单是否清楚2没填写！',''); return; }
    if (list_3=='') { getErrMsg('送货单是否清楚3没填写！',''); return; }
    if (tangent_1==0) { getErrMsg('明切线是否一致没填选！',''); return; }
    if (tangent_2=='') { getErrMsg('明切线是否一致2没填写！',''); return; }
    if (tangent_3=='') { getErrMsg('明切线是否一致3没填写！',''); return; }
    if (pack_1==0) { getErrMsg('包装是否整齐没填选！',''); return; }
    if (pack_2=='') { getErrMsg('包装是否整齐2没填写！',''); return; }
    if (pack_3=='') { getErrMsg('包装是否整齐3没填写！',''); return; }
    if (ironing_1==0) { getErrMsg('整烫是否平服没填选！',''); return; }
    if (ironing_2=='') { getErrMsg('整烫是否平服2没填写！',''); return; }
    if (ironing_3=='') { getErrMsg('整烫是否平服3没填写！',''); return; }
    if (devote_1==0) { getErrMsg('加工单位是否配合没填选！',''); return; }
    if (devote_2=='') { getErrMsg('加工单位是否配合2没填写！',''); return; }
    if (devote_3=='') { getErrMsg('加工单位是否配合3没填写！',''); return; }
    var stylelist = {
        styleNo:styleNo,
        fabric:fabric,
        assist:assist,
        orderNum:orderNum,
        cutNum:cutNum,
        staffNum:staffNum,
        trimNum:trimNum,
        backNum:backNum,
        styleNum:styleNum,
        period:period
    };
    var sizelist = {
        waist:[waist_1,waist_2,waist_3,waist_4],
        hip:[hip_1,hip_2,hip_3,hip_4],
        trouser:[trouser_1,trouser_2,trouser_3,trouser_4],
        bust:[bust_1,bust_2,bust_3,bust_4],
        hem:[hem_1,hem_2,hem_3,hem_4]
    };
    var thrumlist = {
        thrum:[thrum_1,thrum_2,thrum_3],
        smear:[smear_1,smear_2,smear_3],
        hair:[hair_1,hair_2,hair_3],
        size:[size_1,size_2,size_3],
        list:[list_1,list_2,list_3],
        tangent:[tangent_1,tangent_2,tangent_3],
        pack:[pack_1,pack_2,pack_3],
        ironing:[ironing_1,ironing_2,ironing_3],
        devote:[devote_1,devote_2,devote_3]
    };
    //console.log(check); return;
    var data = {
        app_access:app_access,
        token:userInfo.token,
        type:userInfo.type,
        cate:userInfo.cate,
        orderId:comOrderTrack.orderId,
        stylelist:stylelist,
        sizelist:sizelist,
        thrumlist:thrumlist,
        detail:detail,
        staffTotalNum:staffTotalNum,
        staffStyleNum:staffStyleNum,
        finishTime:finishTime
    };
    $.ajax({
        type:'post',
        url:getDomain() + 'order/com-order-check-set',
        data:data,
        success:function(res){
            //console.log(res); return;
            if (res.code!=0) {
                getErrMsg(res.msg,''); return;
            }
            //console.log(res.data); return;
            getErrMsg('保存成功！',''); return;
        },
        error:function(){
            console.log('操作失败！'); return;
        }
    });
}

/**
 * 公司，确认验收报告
 * */
function setComCheckSure(){
    var userInfo = cacheGet('userInfo'); //获取用户信息
    var comOrderTrack = cacheGet('comOrderTrack');
    if (userInfo==null || userInfo.token=='undefined') {
        window.location.href = '/h5/login/login.html';
    }
    if (comOrderTrack==null || comOrderTrack.orderId==0) {
        getErrMsg('订单不存在！',''); return;
    }
    var data = {
        app_access:app_access,
        token:userInfo.token,
        type:userInfo.type,
        cate:userInfo.cate,
        orderId:comOrderTrack.orderId
    };
    $.ajax({
        type:'post',
        url:getDomain() + 'order/com-order-sure-set',
        data:data,
        success:function(res){
            //console.log(res); return;
            if (res.code!=0) {
                getErrMsg(res.msg,''); return;
            }
            //console.log(res.data); return;
            getErrMsg('确认成功！',''); return;
        },
        error:function(){
            console.log('操作失败！'); return;
        }
    });
}

/**
 * 工厂，合作中订单
 * */
function getFacOrderTemp(){
    var userInfo = cacheGet('userInfo'); //获取用户信息
    if (userInfo==null || userInfo.token=='undefined') {
        window.location.href = '/h5/login/login.html';
    }
    var data = {
        app_access:app_access,
        token:userInfo.token,
        type:userInfo.type,
        cate:userInfo.cate
    };
    $.ajax({
        type:'post',
        url:getDomain() + 'order/fac-order-make-get',
        data:data,
        success:function(res){
            //console.log(res); return;
            if (res.code!=0) {
                $('#orderlist').html('<p style="text-align:center;line-height:100px;">没有记录</p>');
                console.log(res); return;
            }
            //console.log(res.data); return;
            var data = res.data;
            var i, h = '';
            //for (i=0;i<data.length;i++) {
            //    h += '<div class="tab-panel-item tab-active">';
            //    h +=    '<a class="aui-flex" href="">';
            //    h +=        '<div class="aui-look-img">';
            //    if (data[i].baleImg) {
            //        h += '<img src="'+data[i].baleImg+'" height="100">';
            //    } else {
            //        h += '<img src="/h5/images/tu.png">';
            //    }
            //    h +=        '</div>';
            //    h +=        '<div class="aui-flex-box">';
            //    h +=            '<h3>'+data[i].baleName+'</h3>';
            //    h +=            '<p class="getOrder">'+data[i].comName+'</p>';
            //    h +=        '</div>';
            //    h +=        '<div class="orderNoticeTime">'+data[i].periodName+'</div>';
            //    h +=    '</a>';
            //    h += '</div><hr/>';
            //}
            for (i=0;i<data.length;i++) {
                h += '<table><tr>';
                h +=    '<td>';
                if (data[i].baleImg) {
                    h += '<img src="'+data[i].baleImg+'" width="60">';
                } else {
                    h += '<img src="/uploads/20190227/orderShowSmall01.png" width="60">';
                }
                h +=    '</td>';
                h +=    '<td>';
                h +=        '<p style="line-height:10px">';
                h +=            '<b>'+data[i].baleName+'</b>';
                h +=            '<span onclick="toBaleShow('+data[i].bale+')">货单情况</span>';
                h +=        '</p>';
                h +=        '<small>交货时间：'+data[i].periodName+'</small>';
                //h +=        '<span onclick="setOrderFinish('+data[i].id+')">完成打包</span>';
                h +=        '<span onclick="setFacOrderMakeStatus('+data[i].id+')">确认生产</span>';
                h +=    '</td>';
                h += '</tr></table>';
            }
            $('#orderlist').html(h);
        },
        error:function(){
            console.log('操作失败！'); return;
        }
    });
}

/**
 * 工厂，生产确认，设置
 * */
function setFacOrderMakeStatus(orderId){
    var userInfo = cacheGet('userInfo'); //获取用户信息
    //var comOrderTrack = cacheGet('comOrderTrack');
    if (userInfo==null || userInfo.token=='undefined') {
        window.location.href = '/h5/login/login.html';
    }
    //if (comOrderTrack==null || comOrderTrack.orderId==0) {
    //    getErrMsg('订单不存在！',''); return;
    //}
    var data = {
        app_access:app_access,
        token:userInfo.token,
        type:userInfo.type,
        cate:userInfo.cate,
        orderId:orderId
    };
    $.ajax({
        type:'post',
        url:getDomain() + 'order/fac-order-make-status-set',
        data:data,
        success:function(res){
            //console.log(res); return;
            if (res.code!=0) {
                getErrMsg(res.msg,''); return;
            }
            //console.log(res.data); return;
            getErrMsg('确认成功！',''); return;
        },
        error:function(){
            console.log('操作失败！'); return;
        }
    });
}

/**
 * 货单情况
 * */
function toBaleShow(){
    getErrMsg('对接发布的货单！',''); return;
}

/**
 * 工厂设置，完成订单
 * */
function setOrderFinish(id){
    getErrMsg('工厂设置订单状态！',''); return;
}

/**
 * --------------------
 * 订单
 * --------------------
 * */





/**
 * --------------------
 * 公司招聘
 * --------------------
 * */

/**
 * 获取招聘列表
 * */
function getJobList(){
    var userInfo = cacheGet('userInfo'); //获取用户信息
    if (userInfo==null || userInfo.token=='undefined') {
        window.location.href = '/h5/login/login.html';
    }
    var data = {
        app_access:app_access,
        token:userInfo.token,
        type:userInfo.type,
        cate:userInfo.cate
    };
    $.ajax({
        type:'post',
        url:getDomain() + 'job/list-get',
        data:data,
        success:function(res){
            if (res.code!=0) {
                $('.load').html('暂无招聘信息');
                return false;
            }
            var data = res.data;
            var i, h = '';
            for (i=0;i<data.length;i++) {
                h += '<table>';
                h +=    '<tr>';
                h +=        '<td>';
                if (data[i].userHead) {
                    h += '<img src="'+data[i].userHead+'" width="60">';
                } else {
                    h += '<img src="../images/toux01.png" width="60">';
                }
                h +=        '</td>';
                h +=        '<td>';
                h +=            '<p>';
                h +=                '<b onclick="toJobShow('+data[i].uid+')">'+data[i].uname+'</b>';
                h +=                '<span>'+data[i].statusName+'</span>';
                h +=            '</p>';
                h +=            '<small>'+data[i].detail.substring(0,10)+'..</small>.';
                h +=            '<span onclick="sendInvite('+data[i].uid+')">邀请面试</span>';
                h +=        '</td>';
                h +=    '</tr>';
                h += '</table>';
            }
            $('#joblist').html(h);
        },
        error:function(){
            console.log('操作失败！'); return;
        }
    });
}

/**
 * 简历详情
 * */
function toJobShow(uid){
    getErrMsg('对接简历详情',''); return;
}

/**
 * 发送面试邀请
 * */
function sendInvite(uid){
    getErrMsg('对接面试邀请',''); return;
}

/**
 * --------------------
 * 公司招聘
 * --------------------
 * */





/**
 * 地址前缀
 * */
function getDomain(){
    return '/api/my/';
}


///**
// * -------------------------
// * 本地缓存
// * -------------------------
// * */
//
///**
// * 本地缓存，获取
// * */
//function cacheGet(key){
//    //return localStorage.getItem(key);
//    return JSON.parse(localStorage.getItem(key));
//}
//
///**
// * 本地缓存，新增
// * */
//function cacheSet(key,val){
//    //var cache = cacheGet(key);
//    //if (cache!='undefined') { getErrMsg('已存在！',''); }
//    //localStorage.setItem(key,val);
//    //为防止没有设置值获取后出现object类型 转化出错,提前进行设置空字符串
//    localStorage.setItem(key, "");
//    localStorage.setItem(key, JSON.stringify(val));
//}
//
///**
// * 本地缓存，删除
// * */
//function cacheDel(key){
//    localStorage.removeItem(key);
//}
//
///**
// * 本地缓存，删除
// * */
//function cacheClear(){
//    localStorage.clear();
//}





/**
 * 错误提示框
 * */
function getErrMsg(msg,url){
    var h = '';
    h += '<span>'+msg+'</span>';
    h += '<script>';
    h += 'setTimeout("setErrClose()",1000*3); function setErrClose(){ $("#errMsg").html("").hide(); }';
    if (url!='') {
        h += 'setTimeout("setJump()",1000*3); function setJump(){ window.location.href=\''+url+'\'; }';
    }
    h += '</script>';
    $('#errMsg').html(h).show();
}